import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Administrator
 * Date: 2023-07-16
 * Time: 16:51
 */
public class Test {
    public static void LeftRotateString(String str,int n){
        int left = 0;
        int right = str.length()-1;
        char[] chars = str.toCharArray();
        while(left<right){
            char tmp = chars[left];
            chars[left]= chars[right];
            chars[right]= tmp;
            left++;
            right--;
        }
        for (char x: chars) {
            System.out.print(x);
        }
    }


    public static void main(String[] args) {
        String str = "abcdef";
        LeftRotateString(str,2);
        //System.out.println(str);
    }
    public static void fnid_val(int [][]arr,int row,int col,int num) {
        int rows = row - 1;
        int cols = 0;
        while (rows >= 0 && cols < col) {
            if (arr[rows][cols] > num) {
                rows--;
            } else if (arr[rows][cols] < num) {
                cols++;
            } else {
                System.out.println("找到这个数字了"+arr[rows][cols]);
                break;
            }
        }
        if(rows < 0 || cols >= col){
            System.out.println("找不到了");
        }
    }
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[][] arry = {{1,2,3},{2,3,4},{3,4,5}};
        int k = scanner.nextInt();
        fnid_val(arry,3,3,k);
    }
    public static int[] findNumberAppearOnce(int[] arr) {
        int[] result= new int[2];
        int m = 0;
        for(int num :arr){
            m ^= num;
        }
        int x= 1;
        while((m & x) == 0){
            x<<=1;
        }
        for(int num :arr){
            if((num & x) == 0){
                result[0] ^=num;
            }else{
                result[1] ^=num;
            }
        }
        if(result[0]>result[1]){
            m = result[0];
            result[0] = result[1];
            result[1] = m;
        }
        return result;
    }

        public static void main1(String[] args) {
        int[] arr = {1,2,5,9,5,2};
        int[] ret = findNumberAppearOnce(arr);
            for (int x:ret) {
                System.out.print(x+" ");
            }
        }
}
